package com.flyco.modules.pms.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.flyco.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import com.flyco.poi.excel.annotation.Excel;

/**
 * @Description: 商品信息
 * @Author: flyco
 * @Date:   2019-11-19
 * @Version: V1.0
 */
@Data
@TableName("pms_product")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="pms_product对象", description="商品信息")
public class PmsProduct {

	@ApiModelProperty(value = "商家id")
	private Long partnerId;

	@ApiModelProperty(value = "1-老版本，2-V2版本")
	@Dict(dicCode = "brandCategory")
	private Integer brandCategory;
    
	/**商品ID*/
	@TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "商品ID")
	@JsonSerialize(using= ToStringSerializer.class)
	private Long id;
	/**品牌id*/
	@Excel(name = "品牌id", width = 15)
    @ApiModelProperty(value = "品牌id")
	private Long brandId;
	/**商品分类id*/
	@Excel(name = "商品分类id", width = 15)
    @ApiModelProperty(value = "商品分类id")
	private Long productCategoryId;
	/**运费模版id*/
	@Excel(name = "运费模版id", width = 15)
    @ApiModelProperty(value = "运费模版id")
	private Long feightTemplateId;
	/**商品属性分类id*/
	@Excel(name = "商品属性分类id", width = 15)
    @ApiModelProperty(value = "商品属性分类id")
	private Long productAttributeCategoryId;
	/**商品名称*/
	@Excel(name = "商品名称", width = 15)
	@ApiModelProperty(value = "商品名称")
	private String name;
	/**SKU展示*/
	@Excel(name = "SKU编码", width = 15)
	@ApiModelProperty(value = "SKU编码")
	private String skuCode;
	@Excel(name = "售卖单位", width = 15)
	@ApiModelProperty(value = "售卖单位")
	private String skuUnit;
	@Excel(name = "售卖单位", width = 15)
	@ApiModelProperty(value = "售卖单位")
	private String skuSpec;
	/**SKU展示*/
	@Excel(name = "SKU展示", width = 15)
	@ApiModelProperty(value = "SKU展示")
	private String skuName;
	@ApiModelProperty(value = "sap物料编码")
	private String sapItemCode;
	/**图片*/
	@Excel(name = "图片", width = 15)
    @ApiModelProperty(value = "图片")
	private String pic;
	/**wap图片*/
	@Excel(name = "wap图片", width = 15)
	@ApiModelProperty(value = "wap图片")
	private String picWap;
	/**货号*/
	@Excel(name = "货号", width = 15)
    @ApiModelProperty(value = "货号")
	private String productSn;
	/**删除状态：0->未删除；1->已删除*/
	@Excel(name = "删除状态：0->未删除；1->已删除", width = 15)
    @ApiModelProperty(value = "删除状态：0->未删除；1->已删除")
	@TableLogic
	private String deleteStatus;
	/**上架状态：0->下架；1->上架*/
	@Excel(name = "上架状态：0->下架；1->上架", width = 15)
    @ApiModelProperty(value = "上架状态：0->下架；1->上架")
	private String publishStatus;

	@Excel(name = "上架状态：0->下架；1->上架", width = 15)
	@ApiModelProperty(value = "上架状态：0->下架；1->上架")
	private Integer storeStatus;

	/**新品状态:0->不是新品；1->新品*/
	@Excel(name = "新品状态:0->不是新品；1->新品", width = 15)
    @ApiModelProperty(value = "新品状态:0->不是新品；1->新品")
	private String newStatus;
	/**推荐状态；0->不推荐；1->推荐*/
	@Excel(name = "推荐状态；0->不推荐；1->推荐", width = 15)
    @ApiModelProperty(value = "推荐状态；0->不推荐；1->推荐")
	private String recommandStatus;
	/**热门状态；0->不热门；1->热门*/
	@Excel(name = "热门状态；0->不热门；1->热门", width = 15)
	@ApiModelProperty(value = "热门状态；0->不热门；1->热门")
	private String hotStatus;
	/**审核状态：0->未审核；1->审核通过*/
	@Excel(name = "审核状态：0->未审核；1->审核通过", width = 15)
    @ApiModelProperty(value = "审核状态：0->未审核；1->审核通过")
	private String verifyStatus;
	/**排序*/
	@Excel(name = "排序", width = 15)
    @ApiModelProperty(value = "排序")
	private Integer sort;
	/**销量*/
	@Excel(name = "销量", width = 15)
    @ApiModelProperty(value = "销量")
	private Integer sale;
	/**价格*/
	@Excel(name = "价格", width = 15)
    @ApiModelProperty(value = "价格")
	private java.math.BigDecimal price;
	/**促销价格*/
	@Excel(name = "促销价格", width = 15)
    @ApiModelProperty(value = "促销价格")
	private java.math.BigDecimal promotionPrice;
	/**赠送的成长值*/
	@Excel(name = "赠送的成长值", width = 15)
    @ApiModelProperty(value = "赠送的成长值")
	private Integer giftGrowth;
	/**赠送的积分*/
	@Excel(name = "赠送的积分", width = 15)
    @ApiModelProperty(value = "赠送的积分")
	private Integer giftPoint;
	/**限制使用的积分数*/
	@Excel(name = "限制使用的积分数", width = 15)
    @ApiModelProperty(value = "限制使用的积分数")
	private Integer usePointLimit;
	/**副标题*/
	@Excel(name = "副标题", width = 15)
    @ApiModelProperty(value = "副标题")
	private String subTitle;
	/**商品描述*/
	@Excel(name = "商品描述", width = 15)
    @ApiModelProperty(value = "商品描述")
	private String description;
	/**市场价*/
	@Excel(name = "市场价", width = 15)
    @ApiModelProperty(value = "市场价")
	private java.math.BigDecimal originalPrice;
	/**库存*/
	@Excel(name = "库存", width = 15)
    @ApiModelProperty(value = "库存")
	private Integer stock;
	/**库存预警值*/
	@Excel(name = "库存预警值", width = 15)
    @ApiModelProperty(value = "库存预警值")
	private Integer lowStock;
	/**单位*/
	@Excel(name = "单位", width = 15)
    @ApiModelProperty(value = "单位")
	private String unit;
	/**商品重量，默认为克*/
	@Excel(name = "商品重量，默认为克", width = 15)
    @ApiModelProperty(value = "商品重量，默认为克")
	private java.math.BigDecimal weight;
	/**是否为预告商品：0->不是；1->是*/
	@Excel(name = "是否为预告商品：0->不是；1->是", width = 15)
    @ApiModelProperty(value = "是否为预告商品：0->不是；1->是")
	private String previewStatus;
	/**以逗号分割的产品服务：1->无忧退货；2->快速退款；3->免费包邮*/
	@Excel(name = "以逗号分割的产品服务：1->无忧退货；2->快速退款；3->免费包邮", width = 15)
    @ApiModelProperty(value = "以逗号分割的产品服务：1->无忧退货；2->快速退款；3->免费包邮")
	private String serviceIds;
	/**关键字*/
	@Excel(name = "关键字", width = 15)
    @ApiModelProperty(value = "关键字")
	private String keywords;
	/**备注*/
	@Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
	private String note;
	/**画册图片，连产品图片限制为5张，以逗号分割*/
	@Excel(name = "画册图片，连产品图片限制为5张，以逗号分割", width = 15)
    @ApiModelProperty(value = "画册图片，连产品图片限制为5张，以逗号分割")
	private Object albumPics;
	/**详情标题*/
	@Excel(name = "详情标题", width = 15)
    @ApiModelProperty(value = "详情标题")
	private String detailTitle;
	/**详情描述*/
	@Excel(name = "详情描述", width = 15)
    @ApiModelProperty(value = "详情描述")
	private Object detailDesc;
	/**产品详情网页内容*/
	@Excel(name = "产品详情网页内容", width = 15)
    @ApiModelProperty(value = "产品详情网页内容")
	private Object detailHtml;
	/**移动端网页详情*/
	@Excel(name = "移动端网页详情", width = 15)
    @ApiModelProperty(value = "移动端网页详情")
	private Object detailMobileHtml;
	/**促销开始时间*/
	@Excel(name = "促销开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "促销开始时间")
	private Date promotionStartTime;
	/**促销结束时间*/
	@Excel(name = "促销结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "促销结束时间")
	private Date promotionEndTime;
	/**活动限购数量*/
	@Excel(name = "活动限购数量", width = 15)
    @ApiModelProperty(value = "活动限购数量")
	private Integer promotionPerLimit;
	/**促销类型：0->没有促销使用原价;1->使用促销价；2->使用会员价；3->使用阶梯价格；4->使用满减价格；5->限时购*/
	@Excel(name = "促销类型：0->没有促销使用原价;1->使用促销价；2->使用会员价；3->使用阶梯价格；4->使用满减价格；5->限时购", width = 15)
    @ApiModelProperty(value = "促销类型：0->没有促销使用原价;1->使用促销价；2->使用会员价；3->使用阶梯价格；4->使用满减价格；5->限时购")
	private String promotionType;
	/**品牌名称*/
	@Excel(name = "品牌名称", width = 15)
    @ApiModelProperty(value = "品牌名称")
	private String brandName;
	/**商品分类名称*/
	@Excel(name = "商品分类名称", width = 15)
    @ApiModelProperty(value = "商品分类名称")
	private String productCategoryName;
	/** SPU */
	@Excel(name = "SPU", width = 15)
	@ApiModelProperty(value = "SPU")
	private String spu;
	/**颜色*/
	@Excel(name = "颜色", width = 15)
	@ApiModelProperty(value = "颜色")
	private String color;
	/**创建人*/
	@Excel(name = "创建人", width = 15)
    @ApiModelProperty(value = "创建人")
	private String createBy;
	/**创建时间*/
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
	private Date createTime;
	/**更新人*/
	@Excel(name = "更新人", width = 15)
    @ApiModelProperty(value = "更新人")
	private String updateBy;
	/**更新时间*/
	@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
	private Date updateTime;

	/**微信同步状态*/
	@Excel(name = "微信同步状态", width = 15)
	@ApiModelProperty(value = "微信同步状态")
	private Integer wxStatus;

	/**收藏商品人数*/
	@TableField(exist = false)
	private Integer totalCount;

	//产品id集合
	@TableField(exist = false)
	private String ids;

    //产品id集合
    @TableField(exist = false)
    private String storeId;
    //一级分类id
	@TableField(exist = false)
	private Long productCategoryIdLevel1;

	/**一级分类名称*/
	@TableField(exist = false)
	private String productCategoryNameLevel1;

	/**二级分类名称*/
	@TableField(exist = false)
	private String productCategoryNameLevel2;

	@ApiModelProperty(value = "箱规")
	@TableField(exist = false)
	private String boxUnit;

	@ApiModelProperty(value = "是否需要扫箱码，默认0（依赖新老品标记），1需要扫码出库，2不需要扫码出库")
	private Integer boxCodeFlag;

	public String getBoxUnit(){
		return this.skuSpec+this.getUnit()+"/"+this.skuUnit;
	}
}
